cmake_minimum_required(VERSION 3.10)

project(mult)

add_library(mult SHARED
    mult.cpp
)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_subdirectory(add)

target_link_libraries(mult PUBLIC add)

target_include_directories(mult PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR}/include
)

# installation setup
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Install path prefix" FORCE)

install(TARGETS mult
    ARCHIVE DESTINATION lib
    LIBRARY DESTINATION lib
)
install(DIRECTORY include/ DESTINATION include)